package com.huobi;

import java.net.URI;
import java.net.URISyntaxException;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import lombok.Data;

@Component
@Data
public class HuobiProperty {

    @Value("${uri.protocol:ws://}")
    String protocol;

    @Value("${uri.host:api.huobi.pro}")
    String host;

    @Value("${uri.port:443}")
    String port;

    @Value("${accessKey}")
    String accessKey;

    @Value("${secretKey}")
    String secretKey;
    
    @Value("${uri.order}")
    String orderUrl;

    public URI getURI(final String path) {
        try {
            URI uri = new URI(protocol + host + ":" + port + path);
            return uri;
        } catch (URISyntaxException e) {
            return null;
        }
    }
}
